package com.zqq.user.utils

import com.zqq.baselibrary.common.BaseConstant
import com.zqq.baselibrary.utils.AppPrefsUtils
import com.zqq.provider.common.ProviderConstant
import com.zqq.user.service.bean.UserInfo

/**
 * 本地存储用户相关信息
 * @author zqq on 2018/7/29.
 */
object UserPrefsUtils {

    //退出登录时，传入null,清空存储
    fun putUserInfo(userInfo: UserInfo?) {
        AppPrefsUtils.putString(BaseConstant.KEY_SP_TOKEN, userInfo?.id ?: "")
        AppPrefsUtils.putString(ProviderConstant.KEY_SP_USER_ICON, userInfo?.userIcon ?: "")
        AppPrefsUtils.putString(ProviderConstant.KEY_SP_USER_NAME, userInfo?.userName ?: "")
        AppPrefsUtils.putString(ProviderConstant.KEY_SP_USER_MOBILE, userInfo?.userMobile ?: "")
        AppPrefsUtils.putString(ProviderConstant.KEY_SP_USER_GENDER, userInfo?.userGender ?: "")
        AppPrefsUtils.putString(ProviderConstant.KEY_SP_USER_SIGN, userInfo?.userSign ?: "")
    }

}